// Copyright (c) 2024, lanlian and contributors
// For license information, please see license.txt

frappe.ui.form.on("EMS Maintenance Plan Template", {
	refresh(frm) {
        // 手动生成配件表
        frm.add_custom_button(__('Make EMS Maintenance Item Parts'), () => {
            frappe.call({
                method: "append_part_items",
                doc: frm.doc,
                freeze: true,
                freeze_message: __("running..."),
                callback: function(r) {
                    refresh_field("part_items");
                }
            });
        });
	},
});
